fix(runtime): route late writes around closed capture buffers - #130
Open
furgalep wants to merge 51 commits into
Open
fix(runtime): route late writes around closed capture buffers#130furgalep wants to merge 51 commits into
furgalep wants to merge 51 commits into
Conversation
Signed-off-by: Paul Furgale <pfurgale@nvidia.com>
Signed-off-by: Paul Furgale <pfurgale@nvidia.com>
Signed-off-by: Paul Furgale <pfurgale@nvidia.com>
Signed-off-by: alessiodevoto <adevoto@nvidia.com>
- Persist prompted API keys only after the fetch validates them, so a mistyped key no longer overwrites secrets.yaml on failure. - Drop the api_base override in _llm_endpoint_overrides when api_key_env is configured but unresolved, surfacing a missing-key error instead of an opaque 401. - Remove the port-11434 Ollama sniff in registry_entry; OpenAI-compatible servers on that port are no longer misrouted to ollama_chat/. - Guard next() model lookup against StopIteration and cancel gracefully. - Bound fetch_native_provider_models with a page cap and after_id loop detection. - Invert _DIRECT_ENDPOINT_PROVIDERS to _LOCKED_ENDPOINT_PROVIDERS so every LiteLLM provider except cloud-locked ones accepts --api-base. - Extract _persist_pending_secret and _finalize_alias_and_switch shared by _add_to_registry and _add_native_provider. - Drop the undocumented /model add-to-registry branch (fold into /connect); update two tests accordingly. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> Signed-off-by: alessiodevoto <adevoto@nvidia.com>
- Drop the /connect <provider> name macro entirely. /connect only accepts
a URL; anthropic and ollama shortcuts are gone.
- Detect routing from the URL after normalization:
- api.anthropic.com hostname -> native anthropic/ flow
- probe_ollama_backend hits <root>/api/tags with a 3s timeout;
success routes as ollama_chat/<id> with the root URL as api_base
- otherwise the existing openai/ flow
- Extend registry_entry with an ollama=True kwarg that emits the
ollama_chat prefix and strips /v1 from api_base.
- Remove the hardcoded "anthropic" shortcut from the /connect completer.
- Rewrite the README /connect section around URLs.
- Add test_connect_routes_ollama_backend_via_probe and an autouse
fixture that stubs probe_ollama_backend so unrelated tests do not
touch the network.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Signed-off-by: alessiodevoto <adevoto@nvidia.com>
- Drop --api-base and --api-key-env from the nooa tui CLI and the Config.load overrides map. - Drop TUIConfig.api_base / TUIConfig.api_key_env fields and the settings.yaml comment block that documented them. - Restore get_llm_for_model to its pre-PR single-argument signature; drop _llm_endpoint_overrides and _LOCKED_ENDPOINT_PROVIDERS. - Remove tests covering the removed overrides. - Clean up stale /connect anthropic mention in health_check fix hints and rewrite the README endpoint section to /connect-only. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> Signed-off-by: alessiodevoto <adevoto@nvidia.com>
Rewrite around the user-facing flow (start TUI, run /connect, credentials are stored) and point at .nooa/ for edits via /edit or an external editor. Drop the wire-protocol detection details from the README. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> Signed-off-by: alessiodevoto <adevoto@nvidia.com>
Add short comments next to each example URL (Anthropic, OpenAI, Ollama, vLLM, NVIDIA) so readers see at a glance which backend each entry maps to. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> Signed-off-by: alessiodevoto <adevoto@nvidia.com>
Signed-off-by: alessiodevoto <adevoto@nvidia.com>
Subviews (model picker, API-key prompt) disable mouse_support so users can text-select. The Keys.Any handler for active subviews was appending event.data verbatim to the input buffer, so raw mouse CSI sequences (clicks, moves) landed in fields like the API-key prompt as garbled text. Filter parsed mouse KeyPresses and raw mouse CSI byte shapes before treating input as text. Arrow keys, function keys, and bracketed paste are unaffected. Signed-off-by: alessiodevoto <adevoto@nvidia.com>
Drop mouse escape sequences leaking into TUI subview input
Improve TUI backend connection flow
Small and mid-size models were treating `explanation` as the reply to the user (e.g. rendering "∴ done: Responded to user greeting with agent introduction." instead of an actual greeting) because the field was described generically as "why handle() returned". Docstring and Field description now spell out the per-kind rule: DONE/NEED_INPUT must send user-facing content via self.message() first; WAIT uses explanation as the intended status surface. Includes right/wrong examples so the pattern lands in the JSON schema the LLM sees. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…docs Clarify RespondResult.explanation is not the user reply channel
Signed-off-by: Paul Furgale <pfurgale@nvidia.com>
Signed-off-by: Paul Furgale <pfurgale@nvidia.com>
Signed-off-by: Paul Furgale <pfurgale@nvidia.com>
Signed-off-by: Paul Furgale <pfurgale@nvidia.com>
Signed-off-by: Paul Furgale <pfurgale@nvidia.com>
…bility fix(memory): harden shared SQLite stores
Signed-off-by: Paul Furgale <pfurgale@nvidia.com>
Normalize spaces for agent attributes and quote space-containing MCP names in slash completion.
furgalep
force-pushed
the
fix/runtime-closed-capture-buffer
branch
from
August 12, 2026 21:11
77e9370 to
5cb918a
Compare
Signed-off-by: Paul Furgale <pfurgale@nvidia.com>
* fix(mcp): harden OAuth flow in remote TUI sessions Signed-off-by: Paul Furgale <pfurgale@nvidia.com> * docs(mcp): describe sbx as container runtime Signed-off-by: Paul Furgale <pfurgale@nvidia.com> * fix: address OAuth review findings Signed-off-by: Paul Furgale <pfurgale@nvidia.com> --------- Signed-off-by: Paul Furgale <pfurgale@nvidia.com>
* fix(skills): honor source-tree entry point targets Signed-off-by: Paul Furgale <pfurgale@nvidia.com> * fix(skills): preserve entry point target on reload Signed-off-by: Paul Furgale <pfurgale@nvidia.com> --------- Signed-off-by: Paul Furgale <pfurgale@nvidia.com>
* feat(tui): clear input on first Ctrl-C Signed-off-by: Paul Furgale <pfurgale@nvidia.com> * test(tui): strengthen Ctrl-C input coverage Signed-off-by: Paul Furgale <pfurgale@nvidia.com> --------- Signed-off-by: Paul Furgale <pfurgale@nvidia.com>
* fix(tui): stabilize native scrollback rendering Signed-off-by: Paul Furgale <pfurgale@nvidia.com> * fix(tui): address render review feedback Signed-off-by: Paul Furgale <pfurgale@nvidia.com> --------- Signed-off-by: Paul Furgale <pfurgale@nvidia.com>
Signed-off-by: Paul Furgale <pfurgale@nvidia.com>
furgalep
force-pushed
the
fix/runtime-closed-capture-buffer
branch
from
August 19, 2026 06:31
5cb918a to
f001236
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
write,writelines, andflushbehavior for stale closed buffersValueErrorbehavior for buffers that are not actually closedWhy
Background tasks inherit context variables and may outlive the execution capture that installed a
StringIO. Late logging or exception reporting then writes to a closed buffer and can mask the original failure. This routes only stale, actually-closed buffers to the process stream.Verification
uv run ruff check src/nooa/runtime/stream_wrappers.py tests/runtime/test_stream_wrappers.pyuv run ruff format --check src/nooa/runtime/stream_wrappers.py tests/runtime/test_stream_wrappers.pyuv run pytest -q tests/runtime/test_stream_wrappers.py(49 passed)